<template>
  <div class="home_notice">
    <van-notice-bar left-icon="volume-o" color="#1989fa" background="#ecf9ff">
      <van-swipe
        vertical
        class="notice-swipe"
        :autoplay="3000"
        :show-indicators="false"
      >
        <!--        <van-swipe-item>周六周日持续战斗中~</van-swipe-item>-->
        <!--        <van-swipe-item>仙人抚我顶，结发受长生。</van-swipe-item>-->
        <!--        <van-swipe-item>今人不见古时月，今月曾经照古人。</van-swipe-item>-->
        <van-swipe-item v-for="item in noticeList" :key="item.notice_id">
          {{ item.notice_info }}
        </van-swipe-item>
      </van-swipe>
    </van-notice-bar>
  </div>
</template>

<script>
import { ref } from "vue";
import { getNotice } from "../../../api/home";

export default {
  name: "HomeNotice",
  setup() {
    //数据
    const noticeList = ref([]);
    getNotice().then((res) => {
      // console.log(res);
      noticeList.value = res.data;
    });
    return { noticeList };
  },
};
</script>

<style scoped>
.notice-swipe {
  height: 40px;
  line-height: 40px;
}
</style>
